POV-Ray : Newsgroups : povray.animations : How to animate ??????????????? : Re: How to animate ??????????????? Server Time
2 Jun 2024 10:38:09 EDT (-0400)
  Re: How to animate ???????????????  
From: Dave VanHorn
Date: 20 Feb 2008 16:05:01
Message: <web.47bc95f886d65c51a08ed15e0@news.povray.org>
Here's what I have so far, which errors on the third line of the data file with
"Parse error: Expected 'float, vector, or string literal',, found instead"



//Initialize with safe values
#declare Lines_In_File = 0;
#declare Xval = 1;
#declare Yval = 1;
#declare Zval = 1;

// Sample data, X, Y, Z
//0.128236817,0.17343048,1.06941009
//-0.109255917,-0.005383651,0.765301253
//0.059836132,0.172405022,0.976029181   <--- Errors on this line


//Find how many lines in the file
#fopen MyFile "drop13.csv" read

#while (defined(MyFile))
  #read (MyFile,Xval,Yval,Zval)
  #declare Lines_In_File=Lines_In_File+1 ;
#end

#fclose MyFile

// Having Lines_In_File now holding the lines count

#declare clock=0;
#declare Count=0;

// Read the Nth line
#declare Read_Line = int((1/Lines_In_File)*clock)
#fopen MyFile "bang.csv" read
#while (defined(MyFile))
 #while (Count<Line)
  #read (MyFile,Xval,Yval,Zval)
  #declare Count=Count+1
 #end
#end
#fclose MyFile


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.